home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / rexx.vim < prev    next >
Encoding:
Text File  |  2001-05-02  |  4.4 KB  |  115 lines

  1. " Vim syntax file
  2. " Language:    Rexx
  3. " Maintainer:    Thomas Geulig <geulig@nentec.de>
  4. " Last Change:    2001 May 2
  5. " URL:        http://sites.netscape.net/sharpPeople/vim/syntax/rexx.vim
  6. "            or http://www.crosswinds.net/~vimuser/vim/syntax/rexx.vim
  7. "
  8. " Special Thanks to Dan Sharp <dwsharp@hotmail.com> for comments and additions
  9. " (and providing the webspace)
  10.  
  11. " For version 5.x: Clear all syntax items
  12. " For version 6.x: Quit when a syntax file was already loaded
  13. if version < 600
  14.   syntax clear
  15. elseif exists("b:current_syntax")
  16.   finish
  17. endif
  18.  
  19. syn case ignore
  20.  
  21. " A Keyword is the first symbol in a clause.  A clause begins at the start
  22. " of a line or after a semicolon.  THEN, ELSE, OTHERWISE, and colons are always
  23. " followed by an implied semicolon.
  24. syn match rexxClause "\(^\|;\|:\|then \|else \|otherwise \)\s*\w\+" contains=ALL
  25.  
  26. " Considered keywords when used together in a phrase and begin a clause
  27. syn match rexxKeyword contained "\<signal\( on \(error\|failure\|halt\|notready\|novalue\|syntax\|lostdigits\)\(\s\+name\)\=\)\=\>"
  28. syn match rexxKeyword contained "\<signal off \(error\|failure\|halt\|notready\|novalue\|syntax\|lostdigits\)\>"
  29. syn match rexxKeyword contained "\<call off \(error\|failure\|halt\|notready\)\>"
  30. syn match rexxKeyword contained "\<parse \(upper \)\=\(arg\|linein\|pull\|source\|var\|value\|version\)\>"
  31. syn match rexxKeyword contained "\<numeric \(digits\|form \(scientific\|engineering\|value\)\|fuzz\)\>"
  32. syn match rexxKeyword contained "\<\(address\|trace\)\( value\)\=\>"
  33. syn match rexxKeyword contained "\<procedure\( expose\)\=\>"
  34. syn match rexxKeyword contained "\<do\( forever\)\=\>"
  35.  
  36. " Another keyword phrase, separated to aid highlighting in rexxFunction
  37. syn match rexxKeyword2 contained "\<call\( on \(error\|failure\|halt\|notready\)\(\s\+name\)\=\)\=\>"
  38.  
  39. " Considered keywords when they begin a clause
  40. syn match rexxKeyword contained "\<\(arg\|drop\|end\|exit\|if\|interpret\|iterate\|leave\|nop\)\>"
  41. syn match rexxKeyword contained "\<\(options\|pull\|push\|queue\|return\|say\|select\|trace\)\>"
  42.  
  43. " Conditional phrases
  44. syn match rexxConditional "\(^\s*\| \)\(to\|by\|for\|until\|while\|then\|when\|otherwise\|else\)\( \|\s*$\)" contains=ALLBUT,rexxConditional
  45. syn match rexxConditional contained "\<\(to\|by\|for\|until\|while\|then\|when\|else\|otherwise\)\>"
  46.  
  47. " Assignments -- a keyword followed by an equal sign becomes a variable
  48. syn match rexxAssign "\<\w\+\s*=\s*" contains=rexxSpecialVariable
  49.  
  50. " Functions/Procedures
  51. syn match rexxFunction    "\<\h\w*\(/\*\s*\*/\)*("me=e-1 contains=rexxComment,rexxConditional,rexxKeyword
  52. syn match rexxFunction    "\<\(arg\|trace\)\(/\*\s*\*/\)*("me=e-1
  53. syn match rexxFunction    "\<call\( on \(error\|failure\|halt\|notready\)\(\s\+name\)\=\)\=\>\s\+\w\+\>" contains=rexxKeyword2
  54.  
  55. " String constants
  56. syn region rexxString      start=+"+ skip=+\\\\\|\\'+ end=+"+
  57. syn region rexxString      start=+'+ skip=+\\\\\|\\"+ end=+'+
  58. syn match  rexxCharacter  +"'[^\\]'"+
  59.  
  60. " Catch errors caused by wrong parenthesis
  61. syn region rexxParen transparent start='(' end=')' contains=ALLBUT,rexxParenError,rexxTodo,rexxUserLabel,rexxKeyword
  62. syn match rexxParenError     ")"
  63. syn match rexxInParen        "[\\[\\]{}]"
  64.  
  65. " Comments
  66. syn region rexxComment        start="/\*" end="\*/" contains=rexxTodo,rexxComment
  67. syn match  rexxCommentError    "\*/"
  68.  
  69. syn keyword rexxTodo contained    TODO FIXME XXX
  70.  
  71. " Highlight User Labels
  72. syn match rexxUserLabel         "\<\I\i*\s*:"me=e-1
  73.  
  74. " Special Variables
  75. syn keyword rexxSpecialVariable  sigl rc result
  76. syn match   rexxCompoundVariable "\<\w\+\.\w*\>"
  77.  
  78. if !exists("rexx_minlines")
  79.   let rexx_minlines = 10
  80. endif
  81. exec "syn sync ccomment rexxComment minlines=" . rexx_minlines
  82.  
  83. " Define the default highlighting.
  84. " For version 5.7 and earlier: only when not done already
  85. " For version 5.8 and later: only when an item doesn't have highlighting yet
  86. if version >= 508 || !exists("did_rexx_syn_inits")
  87.   if version < 508
  88.     let did_rexx_syn_inits = 1
  89.     command -nargs=+ HiLink hi link <args>
  90.   else
  91.     command -nargs=+ HiLink hi def link <args>
  92.   endif
  93.  
  94.   HiLink rexxUserLabel        Function
  95.   HiLink rexxCharacter        Character
  96.   HiLink rexxParenError        rexxError
  97.   HiLink rexxInParen        rexxError
  98.   HiLink rexxCommentError    rexxError
  99.   HiLink rexxError        Error
  100.   HiLink rexxKeyword        Statement
  101.   HiLink rexxKeyword2        rexxKeyword
  102.   HiLink rexxFunction        Function
  103.   HiLink rexxString        String
  104.   HiLink rexxComment        Comment
  105.   HiLink rexxTodo        Todo
  106.   HiLink rexxSpecialVariable    Special
  107.   HiLink rexxConditional    rexxKeyword
  108.  
  109.   delcommand HiLink
  110. endif
  111.  
  112. let b:current_syntax = "rexx"
  113.  
  114. "vim: ts=8
  115.